home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / s / Delete-until-Line.tked < prev    next >
Text File  |  1996-09-26  |  1KB  |  41 lines

  1. /** --------------------------------------------------------------------
  2.  ** ARexx program to delete from the current line down until a specified
  3.  ** word is found 
  4.  ** --------------------------------------------------------------------
  5.  ** AREXX-Programm, das den Text von der aktuellen Zeile an bis zu einer
  6.  ** gesuchten Wort löscht
  7.  ** --------------------------------------------------------------------  
  8.  **
  9.  ** © Tom Kroener '92
  10.  **
  11.  **/
  12.  
  13. LF = '0A'X                      /* Linefeed */
  14.  
  15. options results
  16. address 'TKEd.1'                /* Portname of the first started TKEd */
  17. GetNumber "Enter last line"     /* Get the linnumber of the last line to 
  18.                                    delete */
  19. End = result
  20. GetLineNr                       /* Get number of the current line */
  21. Start = result
  22.  
  23. Mark                            /* Beginto mark the block to delete */
  24.  
  25. DO WHILE Start <= End           /* Marks until it reaches the last line 
  26.                                    to delete */
  27.   Cursor "DOWN"                 /* Goto next line */
  28.   Start = Start + 1             /* Increment linecounter */
  29. END
  30.  
  31. Request2 "Delete marked block" LF "Are you sure?"   /* Request the user */
  32.  
  33. IF result = 10 THEN             /* Cancel: Unmark and exit */
  34.   DO; UnmarkBlock
  35.       EXIT 10
  36.   END
  37. Delete                          /* OK    : Delete block */
  38.  
  39. EXIT 0                          /* ciao */
  40.  
  41.